﻿ //var auth = "@(Request.Cookies[FormsAuthentication.FormsCookieName] == null ? string.Empty : Request.Cookies[FormsAuthentication.FormsCookieName].Value)";
 //var username = "@((Session["User"] as User) != null ? (Session["User"] as User).Username : "")";
                function MainViewModel() {
                    var self = this;
                   
                    Sammy(function () {
                    this.element_selector = '#mainBody';
                    var hideAll = function () {
                        $("#Home").hide();
                        $("#MyProfiles").hide();
                        $("#Experts").hide();
                        $("#Companies").hide();
                        $("#Positions").hide();
                        $("#Education").hide();
                        $("#Categories").hide();
                        $("#Countries").hide();
                        $("#MyProfiles").hide();
                        $("#MyCompanies").hide();
                        $("#MyPositions").hide();
                    };
                    this.get('#/', function (context) {
                        hideAll();
                        $("#Home").show();
                    });
                    this.get("#/Experts", function () {
                        hideAll();
                        self.profile.loadEducations();
                        self.profile.loadCountries();
                        self.profile.loadLanguageSkills();
                        self.profile.getChildCategories(null);
                        self.profile.loadProfiles();
                        $("#Experts").show();
                    });
                    this.get("#/Companies", function () {
                        hideAll();
                        self.company.loadCompanies();
                        $("#Companies").show();
                    });
                    this.get("#/Positions", function () {
                        hideAll();
                        self.project.loadPositions();
                        $("#Positions").show();
                    });
                    this.get("#/MyProfiles", function () {
                        hideAll();
                        self.profile.loadEducations();
                        self.profile.loadCountries();
                        self.profile.loadLanguageSkills();
                        self.profile.getChildCategories(null);
                        self.profile.loadMyProfiles();
                        $("#MyProfiles").show();
                    });
                     this.get("#/MyCompanies", function () {
                        hideAll();
                        self.company.loadMyCompanies();
                        $("#MyCompanies").show();
                    });
                     this.get("#/MyPositions", function () {
                        hideAll();
                        self.project.loadMyPositions();
                        self.project.loadMyCompaniesForPositions();
                        self.project.getChildCategories(null);
                        $("#MyPositions").show();
                    });
                    this.get("#/Education", function () {
                        self.education.loadEducations();
                        hideAll();
                        $("#Education").show();
                    });
                    this.get("#/Categories", function () {
                        self.category.loadCategories();
                        hideAll();
                        $("#Categories").show();
                    });
                    this.get("#/Countries", function () {
                        self.country.loadCountries();
                        hideAll();
                        $("#Countries").show();
                    });
                }).run('#/');
     
                }